import { createApp } from 'vue'
import App from './App.vue'
import router from './router'  // 确保这行存在
import { library } from '@fortawesome/fontawesome-svg-core'
import { 
  faChartLine, faHome, faChartPie, faDatabase, faUsers, 
  faCog, faShieldAlt, faHistory, faBars, faSun, faMoon, 
  faBell, faIndent, faOutdent, faChevronRight, faArrowUp, 
  faArrowDown, faShoppingCart, faExclamationCircle
} from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'

import ElementPlus from 'element-plus'
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import 'element-plus/dist/index.css';




// 添加图标
library.add(
  faChartLine, faHome, faChartPie, faDatabase, faUsers, 
  faCog, faShieldAlt, faHistory, faBars, faSun, faMoon, 
  faBell, faIndent, faOutdent, faChevronRight, faArrowUp, 
  faArrowDown, faShoppingCart, faExclamationCircle
)

const app = createApp(App)

// 全局注册 Font Awesome 组件
app.component('font-awesome-icon', FontAwesomeIcon)

// 使用路由
app.use(router)
app.use(ElementPlus, {
  locale: zhCn,
});

app.mount('#app')
